﻿<%@ Control Language="C#" EnableViewState="true" %>
<%@ Register Assembly="Antu.WebControls" Namespace="Antu.WebControls" TagPrefix="CBW" %>
<script type="text/javascript" language="javascript">
    var arrProjectInfo = new Array(); /*保存项目信息*/
    var url = document.URL;
    var strurl = url.substring(url.indexOf("?") + 1, url.length).split("&");
    var tt = strurl[0].substring(strurl[0].indexOf("=") + 1, strurl[0].length);

    /*返回选中的项目信息*/
    function GetSelectProjectInfo() {
        if (document.getElementById("project_id").value == '') {
            alert('请选择数据!');
            return;
        }
        arrProjectInfo.length = 0;
        var id = document.getElementById("project_id").value; /*项目编号*/
        var row = document.getElementById(id);               /*返回table的一行*/

        arrProjectInfo[0] = id;

        if (row != undefined) {
            if (row.cells[2].innerText != '') {
                if (tt == "xzxm") {
                    arrProjectInfo[1] = row.cells[2].innerText; /*立项号*/
                    arrProjectInfo[2] = row.cells[3].innerText; /*项目名称*/
                    arrProjectInfo[3] = row.cells[4].innerText; /*征收实施单位*/
                    arrProjectInfo[4] = row.cells[5].innerText; /*征收许可证号*/
                    arrProjectInfo[5] = row.cells[6].innerText; /*征收许可证号*/
                    arrProjectInfo[6] = row.cells[7].innerText; /*征收部门*/
                }
                if (tt == "xzxc") {
                    arrProjectInfo[1] = row.cells[2].innerText; /*立项号*/
                    arrProjectInfo[2] = row.cells[4].innerText; /*征收实施单位*/
                    arrProjectInfo[3] = row.cells[5].innerText; /*征收许可证号*/
                    arrProjectInfo[4] = row.cells[6].innerText; /*征收许可证号*/
                }
                if (tt == "khyh") {
                    arrProjectInfo[1] = row.cells[2].innerText; /*单位名称*/
                }
                if (tt == "jftz") {
                    arrProjectInfo[1] = row.cells[2].innerText; /*立项号*/
                    arrProjectInfo[2] = row.cells[3].innerText; /*项目名称*/
                    arrProjectInfo[3] = row.cells[4].innerText; /*建设单位*/
                    arrProjectInfo[4] = row.cells[5].innerText; /*项目地址*/
                    arrProjectInfo[5] = row.cells[6].innerText; /*许可证号*/
                }
                if (tt == "sfxx") {
                    arrProjectInfo[1] = row.cells[2].innerText; /*立项号*/
                    arrProjectInfo[2] = row.cells[3].innerText; /*项目名称*/
                    arrProjectInfo[3] = row.cells[4].innerText; /*征收时间*/
                    arrProjectInfo[4] = row.cells[5].innerText; /*项目地址*/
                    arrProjectInfo[5] = row.cells[6].innerText; /*征收许可证号*/
                }
                if (tt == "xfzdry") {
                    arrProjectInfo[1] = row.cells[2].innerText; /*项目名称*/
                    arrProjectInfo[2] = row.cells[3].innerText; /*项目地址*/
                    arrProjectInfo[3] = row.cells[4].innerText; /*征收期限*/
                    arrProjectInfo[4] = row.cells[5].innerText; /*许可证号*/
                    arrProjectInfo[5] = row.cells[6].innerText; /*征收人*/
                    arrProjectInfo[6] = row.cells[7].innerText; /*征收实施单位*/
                    arrProjectInfo[7] = row.cells[8].innerText; /*评估机构*/
                    arrProjectInfo[8] = row.cells[9].innerText; /*区属*/
                }
                if (tt == "xzxmx") {
                    arrProjectInfo[1] = row.cells[2].innerText; /*征收决定号*/
                    arrProjectInfo[2] = row.cells[3].innerText; /*征收部门*/
                    arrProjectInfo[3] = row.cells[4].innerText; /*征收实施单位*/
                    arrProjectInfo[4] = row.cells[5].innerText; /*项目地址*/
                    arrProjectInfo[5] = row.cells[6].innerText; /*项目名称*/
                    arrProjectInfo[6] = row.cells[7].innerText; /*居民户数*/
                    arrProjectInfo[7] = row.cells[8].innerText; /*工企单位*/
                    arrProjectInfo[8] = row.cells[9].innerText; /*房屋建筑面积*/
                    arrProjectInfo[9] = row.cells[10].innerText; /*征收期限*/
                }
                if (tt == "xzxmzj") {
                    arrProjectInfo[1] = row.cells[2].innerText; /*立项号*/
                    arrProjectInfo[2] = row.cells[4].innerText; /*征收部门*/
                    arrProjectInfo[3] = row.cells[5].innerText; /*征收实施单位*/
                }
                if (unescape(tt).indexOf("房屋征收程序申请") > -1 || unescape(tt).indexOf("房屋征收立项申请") > -1) {
                    arrProjectInfo[2] = row.cells[3].innerText; /*立项号*/
                }
                if (unescape(tt) == "房屋征收补偿实施方案申请") {
                    arrProjectInfo[2] = row.cells[3].innerText;
                }
                /*房屋征收补偿决定申请*/
                if (unescape(tt) == "房屋征收决定申请") {
                    arrProjectInfo[2] = row.cells[3].innerText;
                }
                if (unescape(tt) == "房屋征收决定申请(区县)") {
                    arrProjectInfo[2] = row.cells[3].innerText;
                }
                if (unescape(tt) == "房屋征收冻结申请") {
                    arrProjectInfo[2] = row.cells[3].innerText;
                }
                if (unescape(tt) == "房屋征收补偿决定审批(区县预审)") {
                    arrProjectInfo[2] = row.cells[4].innerText;
                }
                if (unescape(tt) == "房屋征收补偿决定审批(预审)") {
                    arrProjectInfo[2] = row.cells[4].innerText;
                }
                if (unescape(tt) == "房屋征收补偿资金监管") {
                    arrProjectInfo[2] = row.cells[3].innerText;
                }
                if (unescape(tt) == "房屋征收补偿方案申请") {
                    arrProjectInfo[2] = row.cells[3].innerText;
                }
            }
        }
        window.returnValue = arrProjectInfo;
        self.close();
    }
    function setValue(obj) {
        var element = document.getElementsByTagName("input");

        if (element.length > 0) {
            for (var i = 0; i < element.length; i++)
                if (element[i].type == 'radio')
                element[i].checked = false;
        }
        obj.checked = true;
        document.getElementById("project_id").value = obj.id;
    }

    function setNull() {
        arrProjectInfo.length = 0;
    }
    function request(paras) {
        var url = location.href;
        var paraString = url.substring(url.indexOf("?") + 1, url.length).split("&");
        var returnValue;
        for (i = 0; i < paraString.length; i++) {
            if (paraString[i] != "") {
                if (paras.toString().toLowerCase() == paraString[i].substring(0, paraString[i].indexOf("=")).toLowerCase()) {
                    returnValue = paraString[i].substring(paraString[i].indexOf("=") + 1, paraString[i].length)
                }
            }
        }
        if (typeof (returnValue) == "undefined") {
            return "";
        } else {
            return returnValue;
        }
    }
    window.onload = function aa() {

        if (unescape(tt) == "xzxm" || unescape(tt) == "xzxmzj" || unescape(tt) == "xzxmx" || unescape(tt) == "xzxc" || unescape(tt) == "jftz" || unescape(tt) == "sfxx" || unescape(tt) == "xfzdry") {
            document.getElementById('ZS_SelectProject1Control___lblHeader').innerHTML = "征收项目";
        } else if (unescape(tt) == "khyh") {
            document.getElementById('ZS_SelectProject1Control___lblHeader').innerHTML = "开户银行";
            document.getElementById('ZS_SelectProject1Control___lblAddress').innerHTML = '';
            document.getElementById('ZS_SelectProject1Control___txtAddress').setAttribute("style", "display:none");
        }
        else {
            document.getElementById('ZS_SelectProject1Control___lblHeader').innerHTML = unescape(tt);
        }
        if (unescape(tt).indexOf("房屋征收程序申请") > -1 || unescape(tt).indexOf("房屋征收立项申请") > -1 || unescape(tt).indexOf("房屋征收冻结申请") > -1 || unescape(tt).indexOf("房屋征收补偿方案申请") > -1
            || unescape(tt).indexOf("房屋征收补偿实施方案申请") > -1 || unescape(tt).indexOf("房屋征收决定申请") > -1) {
            document.getElementById('ZS_SelectProject1Control___lblName').innerHTML = '项目名称';
        }
        if (unescape(tt).indexOf("房屋征收补偿决定审批") > -1) {
            document.getElementById('ZS_SelectProject1Control___lblName').innerHTML = '产权人';
            document.getElementById('ZS_SelectProject1Control___lblAddress').innerHTML = '';
            document.getElementById('ZS_SelectProject1Control___txtAddress').setAttribute("style", "display:none");
        }

    };
</script>

<center>
    <table border="0" cellpadding="0" cellspacing="0" width="100%" class="window_tab_list">
        <tr>
            <th height="30px">
                <strong>
                    <asp:Label ID="lblHeader" runat="server"></asp:Label>选择</strong><span style="font-size: 12px;
                        color: Red;">(请点击查询进行数据刷新)</span>
            </th>
        </tr>
        <tr>
            <td>
                <asp:Label runat="server" ID="lblAddress" Text="项目地址"></asp:Label><asp:TextBox runat="server" ID="txtAddress"></asp:TextBox>
                <asp:Label ID="lblName" runat="server"></asp:Label>:<asp:TextBox ID="txt_name" runat="server"
                    Width="100"></asp:TextBox>
                <asp:Button ID="bt_query" runat="server" Text="查询" />
            </td>
        </tr>
        <tr>
            <td width="100%">
                <CBW:CustomGridView runat="server" ID="CustomGridView1" ShowCmpAndCancel="false"
                    CssClass="window_tab_list" ShowGridViewSelect="List" ShowHideColModel="None"
                    PageSize="10" AllowPaging="true" Width="100%" AutoGenerateColumns="true" CustomGridViewClass="window_tab_list_fst">
                    <Columns>
                    </Columns>
                </CBW:CustomGridView>
            </td>
        </tr>
        <tr>
            <td align="center" height="30px">
                <asp:Button ID="bt_ok" runat="server" SkinID="LightGreen" Text="确定" OnClientClick="GetSelectProjectInfo();return false;" />
                <asp:Button ID="bt_cancel" runat="server" SkinID="LightGreen" Text="关闭" OnClientClick="javascript:self.close();return false;" />
            </td>
        </tr>
    </table>
</center>
<input type="hidden" value="" id="project_id" />